package xyz.yzy.coc.myqqrobot.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import com.forte.qqrobot.beans.messages.msgget.GroupMsg;

import xyz.yzy.coc.myqqrobot.entity.QqRecord;

public class Qqrobot {

	
	public static void bbb(GroupMsg msg){
		String sql="INSERT INTO qq_record (id,type,qunnumber,qqnumber,msg,time)  VALUES(null,?,?,?,?,?)";
		System.out.println(sql);
		Connection conn = ConnectionFactorctry.getConnection();
		try {
			PreparedStatement pstem = conn.prepareStatement(sql);
			if(msg.getMsg()!=null){
				pstem.setString(1, "msg.get");
				pstem.setString(2, msg.getGroup());
				pstem.setString(3, msg.getQQ());
				pstem.setString(4, msg.getMsg());
				pstem.setLong(5, msg.getTime());
				pstem.execute();
				
			}
			conn.close();
		} catch (SQLException e) {
			System.out.println("抛出异常了啊");
			
			
			e.printStackTrace();
		}
	}
}
